﻿<%@ Page Title="Job Setup" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="JobSetup.aspx.cs" Inherits="LoadController.JobSetup" ValidateRequest="false" %>
<%@ PreviousPageType VirtualPath="~/Soap.aspx" %> 
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <%--<script type="text/javascript" src="/jQdataTables/jquery.dataTables.js"></script>--%>
    <section class="featured">
        <div class="content-wrapper" style="width: 80%; margin-left:10%">
            <hgroup class="title">
                <h1><%: Title %></h1>           
            </hgroup>
            <br /><br />
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">        
    <style type="text/css">
        .warning
        {
         color: red;
         margin: 0px;
         padding: 15px;
        }
    </style>
    <div style="width: 80%; margin-left:10%">

        <h2>General</h2>
                
        <asp:Label Text="Job Name" runat="server" />
        <asp:TextBox ID="JobNameTextBox" runat="server" Text="unnamed" /> 


        <asp:Label Text="Duration (min)" runat="server" />        
        <asp:DropDownList ID="DurationDropDownList" runat="server">
        </asp:DropDownList>
                
        <br /><br /><br />
        
        <h2>Load Generators</h2>
               
        <asp:UpdatePanel  runat="server">
            <ContentTemplate>
                <asp:Panel ID="Pan1" Height="250px" Width="100%" ScrollBars="Auto" runat="server">
                <asp:Repeater ID="repeater1" runat="server"  OnPreRender="repeater1_PreRender">
                    <HeaderTemplate>                                                      
                        <asp:ValidationSummary ID="ValidationSummary1" 
                            HeaderText="Errors in the following fields:"
                            DisplayMode="BulletList"
                            EnableClientScript="true"
                            CssClass="warning"
                            runat="server" ValidationGroup="MyGroup" />
                        <table>
                            <tr runat="server" id="trHeader">
                                <td>Name</td>
                                <td>StartUpDelay (min)</td>
                                <td>Threads (1-100)</td>
                                <td>ThreadStartUpDelay (sec)</td>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <asp:Label ID="lblInstanceName" runat="server" Width="100%" 
                                    Text='<%#DataBinder.Eval(Container.DataItem, "InstanceName")%>' />
                            </td>
                            <td>
                                <asp:TextBox ID="txtStartUpDelay" runat="server" Width="100%" 
                                    Text='<%#DataBinder.Eval(Container.DataItem, "StartUpDelay")%>'  />       
                            </td>
                            <td>
                                <asp:TextBox ID="txtNumberOfThreads" runat="server" Width="100%" 
                                    Text='<%#DataBinder.Eval(Container.DataItem, "NumberOfThreads")%>'  />
                            </td>
                            <td>
                                <asp:TextBox ID="txtThreadStartUpDelay" runat="server" Width="100%" 
                                    Text='<%#DataBinder.Eval(Container.DataItem, "ThreadStartUpDelay")%>'   />
                            </td>
                        </tr>
                        
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>                       
                    </FooterTemplate>
                </asp:Repeater>
                    </asp:Panel>
                <br />                              
                <asp:Button ID="btnAdd" runat="server" Text="Add" CommandName="Add" OnClick="btnAdd_Click" />          
                <asp:Button ID="btnRemove" runat="server" Width="70" Text="Remove" CommandName="Remove" OnClick="btnRemove_Click" />
                         
            </ContentTemplate>
        </asp:UpdatePanel>
        <br /><br />

        <asp:Button ID="Button1" Text="Queue Job" runat="server" OnClick="QueueJob_Click" />
                      
    </div>
</asp:Content>
